import axios from "axios";

// 生成订单
export const createOrder = (data) => {
    return axios({
        url: "/order/create",
        method: "post",
        data
    });
};
// 生成订单（现金）
export const createOrderCash = (data) => {
    return axios({
        url: "/order/createCash",
        method: "post",
        data
    });
};

// 获取订单列表
export const getOrderList = (params) => {
    return axios({
        url: "/order/page",
        method: "get",
        params
    });
};
// 获取订单详情
export const getOrderDetail = (id) => {
    return axios({
        url: "/order/detail/" + id,
        method: "get"
    });
};
// 删除订单
export const deleteOrder = (id) => {
    return axios({
        url: "/order/delete/" + id,
        method: "get"
    });
};
// 修改订单
export const updateOrder = (params, data) => {
    return axios({
        url: "/order/update/" + params,
        method: "post",
        data
    });
};
//完成订单
export const overOrder = (params) => {
    return axios({
        url: "/order/complete/" + params,
        method: "get"
    });
};

// 取消订单
export const cancelOrder = (params) => {
    return axios({
        url: "/order/cancel/" + params,
        method: "get"
    });
};
